// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_pr.p_activity.p_a;

import android.view.View;
import android.view.ViewGroup;
import android.widget.*;
import java.util.*;

// Referenced classes of package com.nnee.p_pr.p_activity.a:
//            ah, c, aj

public class cls_al extends BaseAdapter
    implements cls_SectionIndexer
{

    public al()
    {
        a = new ArrayList();
        b = new ArrayList();
        c = new HashMap();
    }

    public ListAdapter a(int i)
    {
        Iterator iterator = a.iterator();
_L3:
        ListAdapter listadapter;
        int j;
        if(!iterator.hasNext())
            break MISSING_BLOCK_LABEL_51;
        listadapter = (ListAdapter)iterator.next();
        j = listadapter.getCount();
        if(i >= j) goto _L2; else goto _L1
_L1:
        return listadapter;
_L2:
        i -= j;
          goto _L3
        listadapter = null;
          goto _L1
    }

    public ListAdapter a(String s, int i)
    {
        ListAdapter listadapter = (ListAdapter)c.get(s);
        if(i != 0) goto _L2; else goto _L1
_L1:
        if(!a.contains(listadapter)) goto _L4; else goto _L3
_L3:
        return listadapter;
_L4:
        int j = b.indexOf(listadapter);
        if(j == -1)
            continue; /* Loop/switch isn't completed */
        int k = j + -1;
        do
        {
            if(k < 0)
                break;
            int l = a.indexOf(b.get(k));
            if(l > -1)
            {
                a.add(l + 1, listadapter);
                continue; /* Loop/switch isn't completed */
            }
            k--;
        } while(true);
        a.add(0, listadapter);
        continue; /* Loop/switch isn't completed */
_L2:
        a.remove(listadapter);
        if(true) goto _L3; else goto _L5
_L5:
    }

    public void a()
    {
        c.clear();
        b.clear();
        a.clear();
_L1:
        return;
        NullPointerException nullpointerexception;
        nullpointerexception;
        nullpointerexception.printStackTrace();
          goto _L1
    }

    public void a(String s, View view)
    {
        a(s, view, false);
    }

    public void a(String s, View view, boolean flag)
    {
        ArrayList arraylist = new ArrayList(1);
        arraylist.add(view);
        a(s, ((List) (arraylist)), flag);
    }

    public void a(String s, ListAdapter listadapter)
    {
        c.put(s, listadapter);
        b.add(listadapter);
        listadapter.registerDataSetObserver(new cls_ah(this, null));
    }

    public void a(String s, List list)
    {
        a(s, list, false);
    }

    public void a(String s, List list, boolean flag)
    {
        if(flag)
            a(s, ((ListAdapter) (new cls_c(list))));
        else
            a(s, ((ListAdapter) (new cls_aj(list))));
    }

    public boolean areAllItemsEnabled()
    {
        return false;
    }

    public int getCount()
    {
        Iterator iterator = a.iterator();
        int i;
        for(i = 0; iterator.hasNext(); i += ((ListAdapter)iterator.next()).getCount());
        return i;
    }

    public Object getItem(int i)
    {
        Iterator iterator = a.iterator();
_L3:
        ListAdapter listadapter;
        int j;
        if(!iterator.hasNext())
            break MISSING_BLOCK_LABEL_62;
        listadapter = (ListAdapter)iterator.next();
        j = listadapter.getCount();
        if(i >= j) goto _L2; else goto _L1
_L1:
        Object obj = listadapter.getItem(i);
_L4:
        return obj;
_L2:
        i -= j;
          goto _L3
        obj = null;
          goto _L4
    }

    public long getItemId(int i)
    {
        Iterator iterator = a.iterator();
_L3:
        ListAdapter listadapter;
        int j;
        if(!iterator.hasNext())
            break MISSING_BLOCK_LABEL_62;
        listadapter = (ListAdapter)iterator.next();
        j = listadapter.getCount();
        if(i >= j) goto _L2; else goto _L1
_L1:
        long l = listadapter.getItemId(i);
_L4:
        return l;
_L2:
        i -= j;
          goto _L3
        l = -1L;
          goto _L4
    }

    public int getItemViewType(int i)
    {
        Iterator iterator;
        int j;
        iterator = a.iterator();
        j = 0;
_L3:
        ListAdapter listadapter;
        int l;
        if(!iterator.hasNext())
            break MISSING_BLOCK_LABEL_78;
        listadapter = (ListAdapter)iterator.next();
        l = listadapter.getCount();
        if(i >= l) goto _L2; else goto _L1
_L1:
        int k = j + listadapter.getItemViewType(i);
_L4:
        return k;
_L2:
        i -= l;
        j += listadapter.getViewTypeCount();
          goto _L3
        k = -1;
          goto _L4
    }

    public int getPositionForSection(int i)
    {
        int j = 0;
        Iterator iterator = a.iterator();
        int k = j;
        do
        {
label0:
            {
label1:
                {
                    if(iterator.hasNext())
                    {
                        ListAdapter listadapter = (ListAdapter)iterator.next();
                        if(!(listadapter instanceof cls_SectionIndexer))
                            break label0;
                        Object aobj[] = ((SectionIndexer)listadapter).getSections();
                        int l;
                        if(aobj != null)
                            l = aobj.length;
                        else
                            l = j;
                        if(i >= l)
                            break label1;
                        j = k + ((SectionIndexer)listadapter).getPositionForSection(i);
                    }
                    return j;
                }
                if(aobj != null)
                    i -= l;
            }
            k += listadapter.getCount();
        } while(true);
    }

    public int getSectionForPosition(int i)
    {
        int j;
        Iterator iterator;
        int k;
        j = 0;
        iterator = a.iterator();
        k = j;
_L2:
        int l;
        int i1;
        ListAdapter listadapter;
label0:
        {
            if(iterator.hasNext())
            {
                listadapter = (ListAdapter)iterator.next();
                l = listadapter.getCount();
                if(i >= l)
                    break label0;
                if(listadapter instanceof cls_SectionIndexer)
                    j = k + ((SectionIndexer)listadapter).getSectionForPosition(i);
            }
            return j;
        }
        if(!(listadapter instanceof cls_SectionIndexer))
            break; /* Loop/switch isn't completed */
        Object aobj[] = ((SectionIndexer)listadapter).getSections();
        if(aobj == null)
            break; /* Loop/switch isn't completed */
        i1 = k + aobj.length;
_L3:
        i -= l;
        k = i1;
        if(true) goto _L2; else goto _L1
_L1:
        i1 = k;
          goto _L3
        if(true) goto _L2; else goto _L4
_L4:
    }

    public Object[] getSections()
    {
        ArrayList arraylist = new ArrayList();
        Iterator iterator = a.iterator();
        do
        {
            if(!iterator.hasNext())
                break;
            ListAdapter listadapter = (ListAdapter)iterator.next();
            if(listadapter instanceof cls_SectionIndexer)
            {
                Object aobj1[] = ((SectionIndexer)listadapter).getSections();
                if(aobj1 != null)
                {
                    int i = aobj1.length;
                    int j = 0;
                    while(j < i) 
                    {
                        arraylist.add(aobj1[j]);
                        j++;
                    }
                }
            }
        } while(true);
        Object aobj[];
        if(arraylist.size() == 0)
            aobj = null;
        else
            aobj = arraylist.toArray(new Object[0]);
        return aobj;
    }

    public View getView(int i, View view, ViewGroup viewgroup)
    {
        Iterator iterator = a.iterator();
_L3:
        ListAdapter listadapter;
        int j;
        if(!iterator.hasNext())
            break MISSING_BLOCK_LABEL_69;
        listadapter = (ListAdapter)iterator.next();
        j = listadapter.getCount();
        if(i >= j) goto _L2; else goto _L1
_L1:
        View view1 = listadapter.getView(i, view, viewgroup);
_L4:
        return view1;
_L2:
        i -= j;
          goto _L3
        view1 = null;
          goto _L4
    }

    public int getViewTypeCount()
    {
        Iterator iterator = a.iterator();
        int i;
        for(i = 0; iterator.hasNext(); i += ((ListAdapter)iterator.next()).getViewTypeCount());
        return Math.max(i, 1);
    }

    public boolean isEnabled(int i)
    {
        Iterator iterator = a.iterator();
_L3:
        ListAdapter listadapter;
        int j;
        if(!iterator.hasNext())
            break MISSING_BLOCK_LABEL_62;
        listadapter = (ListAdapter)iterator.next();
        j = listadapter.getCount();
        if(i >= j) goto _L2; else goto _L1
_L1:
        boolean flag = listadapter.isEnabled(i);
_L4:
        return flag;
_L2:
        i -= j;
          goto _L3
        flag = false;
          goto _L4
    }

    protected arrayList a;
    protected arrayList b;
    HashMap c;
}
